﻿

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>@ViewBag.Title</title>
    <link href="~/css/framework-font.css" rel="stylesheet" />
    <link href="~/css/framework-theme.css" rel="stylesheet" />
    <script src="~/lib/jquery/1.12.4/jquery.min.js"></script>
    <script src="~/lib/bootstrap/3.3.4/js/bootstrap.min.js"></script>
    <link href="~/lib/bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet" />
    <script src="~/lib/wdtree/tree.js"></script>
    <link href="~/lib/wdtree/tree.css" rel="stylesheet" />
    <link href="~/lib/select2/select2.min.css" rel="stylesheet" />
    <script src="~/lib/select2/select2.min.js"></script>
    <script src="~/lib/laydate/laydate.js"></script>
    <script src="~/lib/moment/moment.js"></script>
    <link href="~/lib/wizard/wizard.css" rel="stylesheet" />
    <script src="~/lib/wizard/wizard.js"></script>
    <script src="~/lib/validate/jquery.validate.min.js"></script>
    <script src="~/lib/datepicker/WdatePicker.js"></script>
    <script src="~/lib/jqgrid/5.3.0/i18n/grid.locale-cn.js"></script>
    <link href="~/css/framework-ui.css" rel="stylesheet" />
    <script src="~/js/framework-ui.js"></script>
</head>
<body>
    <form id="form1">
        <div style="margin-top: 10px; margin-left: 10px; margin-right: 10px;">
            <ul class="nav nav-tabs">
                <li role="presentation" class="active"><a href="#">基本信息</a></li>
                @*<li role="presentation"><a href="#">扩展信息</a></li>*@
            </ul>
            <div style="padding-top: 20px; margin-right: 30px;">
                <table class="form">
                    <tr>
                        <th class="formTitle">上级</th>
                        <td class="formValue">
                            <select id="ParentId" name="ParentId" class="form-control required">
                                <option value="0">父节点</option>
                            </select>
                        </td>
                        <th class="formTitle">类型</th>
                        <td class="formValue">
                            <select id="ObjectType" name="ObjectType" class="form-control required">
                                <option value="">==请选择==</option>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <th class="formTitle">名称</th>
                        <td class="formValue">
                            <input id="FullName" name="FullName" type="text" class="form-control required" placeholder="请输入名称" />
                        </td>
                        <th class="formTitle">编号</th>
                        <td class="formValue">
                            <input id="EnCode" name="EnCode" type="text" class="form-control required" placeholder="请输入编号" />
                        </td>
                    </tr>
                    <tr>
                    <tr>
                        <th class="formTitle">负责人</th>
                        <td class="formValue">
                            <input id="ManagerId" name="ManagerId" type="text" class="form-control" />
                        </td>
                        <th class="formTitle">手机</th>
                        <td class="formValue">
                            <input id="MobilePhone" name="MobilePhone" type="text" class="form-control" />
                        </td>
                    </tr>
                    <tr>
                        <th class="formTitle">微信</th>
                        <td class="formValue">
                            <input id="WeChat" name="WeChat" type="text" class="form-control" />
                        </td>
                        <th class="formTitle">电话</th>
                        <td class="formValue">
                            <input id="TelePhone" name="TelePhone" type="text" class="form-control" />
                        </td>
                    </tr>
                    <tr>

                        <th class="formTitle">邮箱</th>
                        <td class="formValue">
                            <input id="Email" name="Email" type="text" class="form-control" />
                        </td>
                        <th class="formTitle">传真</th>
                        <td class="formValue">
                            <input id="Fax" name="Fax" type="text" class="form-control" />
                        </td>
                    </tr>
                    <tr>
                        <th class="formTitle">地址</th>
                        <td class="formValue">
                            <input id="Address" name="Address" type="text" class="form-control" />
                        </td>
                        <th class="formTitle">排序</th>
                        <td class="formValue">
                            <input id="SortCode" name="SortCode" type="text" class="form-control" />
                        </td>
                    </tr>
                    <tr>
                        <th class="formTitle" style="height: 35px;">选项</th>
                        <td class="formValue" colspan="3" style="padding-top: 1px;">
                            <div class="ckbox">
                                <input id="EnabledMark" name="EnabledMark" type="checkbox" checked="checked"><label for="EnabledMark">有效</label>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <th class="formTitle" valign="top" style="padding-top: 5px;">
                            备注
                        </th>
                        <td class="formValue" colspan="3">
                            <textarea id="Description" name="Descriptions" class="form-control" style="height: 60px;"></textarea>
                        </td>
                    </tr>
                </table>
            </div>
        </div>
    </form>
    <script>
        var keyValue = $.request("keyValue");
        $(function () {
            initControl();
            if (!!keyValue) {
                $.ajax({
                    url: "/SystemManage/Organize/GetFormJson",
                    data: { keyValue: keyValue },
                    dataType: "json",
                    async: false,
                    success: function (data) {
                        $("#form1").formSerialize(data);
                    }
                });
            }
        });
        function initControl() {
            $("#ObjectType").bindSelect({ 
                url: "/SystemManage/DictItem/GetSelectJson",
                param: { enCode: "OrganizeType" }
            })
            $("#ParentId").bindSelect({
                url: "/SystemManage/Organize/GetTreeSelectJson",
            });
        }
        function submitForm() {
            if (!$('#form1').formValid()) {
                return false;
            }
            $.submitForm({
                url: "/SystemManage/Organize/SubmitForm?keyValue=" + keyValue,
                param: $("#form1").formSerialize(),
                success: function () {
                    $.currentWindow().$("#gridList").resetSelection();
                    $.currentWindow().$("#gridList").trigger("reloadGrid");
                }
            })
        }
    </script>
</body>
</html>
